﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Chinook.Core.DomainModel;
using FluentNHibernate.Mapping;

namespace Chinook.Core.FNHMappings
{
    public sealed class EmployeeMap : ClassMap<Employee>
    {
        public EmployeeMap()
        {
            //Table that has been referred to
            Table("Employee");

            //Mapping for Primary key column
            Id(x => x.Id, "EmployeeId").GeneratedBy.Identity();

            //Map table Columns to POCO Fields
            Map(x => x.LastName);
            Map(x => x.FirstName);
            Map(x => x.Title);
            Map(x => x.Address);
            Map(x => x.City);
            Map(x => x.Country);
            Map(x => x.PostalCode);
            Map(x => x.State);
            Map(x => x.Email);
            Map(x => x.Phone);
            Map(x => x.Fax);
            Map(x => x.HireDate);
            Map(x => x.BirthDate);
            //Map(x => x.ReportsTo);
            //many Employees to one Reporting Manager (he is a Employee)
            //References(x => x.ReportsTo);
        }
    }
}
